<template>
	<view class="content">
		<view class="search-box">
			<view class="box">
				<uni-icons class="right-icon" type="search" size="20" color="#7f7f7f"></uni-icons>
			</view>
			<view class="cancel">取消</view>
		</view>
		<view class="choose-new-hot">
			<text v-for="(item,index) in chooseItems" @click="onClickItem" :id="index"  class="new-hot" :class="chooseIndex == index ? 'new-hot-active' : ''">{{item}}</text>
		</view>
		<view class="hot" v-if="chooseIndex == 0"></view>
		<view class="hot" v-if="chooseIndex == 1">
			<activity :act="act" :label="label"></activity>
			
		</view>
		<view class="hot" v-if="chooseIndex == 2"></view>
		<view class="hot" v-if="chooseIndex == 3"></view>
		<view class="hot" v-if="chooseIndex == 4"></view>
		<view class="hot" v-if="chooseIndex == 5">
			<gallery :gallery="gallery"></gallery>
			<view class="gallery">
				<view class="gallery-info">
					<view class="gallery-img"><image :src="gallery.galleryImg"></image></view>
					<view class="gallery-text">
						<view style="font-weight: bold;">{{gallery.galleryName}}</view>
						<view style="font-size: 22rpx;">{{gallery.galleryPlace}}</view>
						<view style="font-size: 22rpx;">{{gallery.galleryFans}}粉丝 | {{gallery.galleryAct}}在办</view>
					</view>
					<view class="gallery-att">
						<button>关注</button>
					</view>
				</view>
				<view class="gallery-content">
					<text>最近活动</text>
					<view class="act" >
						<view class="act-each" v-for="item in gallery.act">
							<view class="act-img"><image :src="item.actImg"></image></view>
							<view class="act-name">{{item.actName}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import activity from '../../components/activities/activity.vue'
	import gallery from '../../components/gallery/gallery.vue'
	export default{
		data(){
			return{
				chooseItems:['综合','活动','用户','帖子','小组','展馆'],
				chooseIndex:0,
				act:[
					{
						id:1,
						acturl:"../../static/swiper/1.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					},
					{
						id:2,
						acturl:"../../static/swiper/2.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					},
					{
						id:3,
						acturl:"../../static/swiper/3.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					},
					{
						id:4,
						acturl:"../../static/swiper/4.jpg",
						actname:"灵感事务所",
						acttime:"2020.09.30-2020.12.31",
						actplace:"杭州  |  杭州天地二层L201"
					}
				],
				label:["娱乐","美国","流行"],
				gallery:{
					galleryImg:'../../static/activities/gallery.jpg',
				    galleryName:'杭州博物馆',
					galleryPlace:'12.9公里 | 新业路39号',
					galleryFans:668,
					galleryAct:10,
					act:[
						{
							actImg:'../../static/swiper/1.jpg',
							actName:'灵感事务所'
						},
						{
							actImg:'../../static/swiper/2.jpg',
							actName:'灵感事务所'
						},
						{
							actImg:'../../static/swiper/3.jpg',
							actName:'灵感事务所'
						},
					]
				}
			}
		},
		components:{
			activity,
			gallery
		},
		methods:{
			onClickItem(e) { 
				this.chooseIndex = e.currentTarget.id
			}
		}
	}
</script>

<style lang="scss">
	.content{
		width: 100%;
		height: 100%;
		.search-box{
			display: flex;
			.cancel{
				margin: 30rpx 30rpx 20rpx 20rpx;
				display: inline-block;
				font-size: 35rpx;
				color: #333333;
			}
			.box{
				display: inline-block;
				margin: 30rpx 10rpx 20rpx 30rpx;
				height: 55rpx;
				background-color: #F2F2F2;
				border-radius: 45rpx;
				border: 1px solid #F2F2F2;
				flex: 1;
				.right-icon{
					margin-left: 10rpx;
					margin-top: 30rpx;
				}
			}
		}
		.choose-new-hot{
			width: 100%;
			height: 100rpx;
			margin-top: 20rpx;
			margin-left: 20rpx;
			display: flex;
			.new-hot{
				flex: 1;
				// margin-left: 30rpx;
				color: #555555;
				font-size: 35rpx;
				
			}
			.new-hot-active{
				flex: 1;
				// margin-left: 30rpx;
				color: #B0E3FF;
				font-size: 35rpx;
				font-weight: bold;
			}
		}
		.gallery{
			margin: 30rpx;
			height: 600rpx;
			box-shadow: 0px 2px 1px rgba(200,200,200,.30);
			border-radius: 30rpx;
			.gallery-info{
				width: 100%;
				height: 180rpx;
				.gallery-img{
					display: inline-block;
					width: 220rpx;
					height: 180rpx;
					image{
						width: 220rpx;
						height: 180rpx;
						border-radius: 30rpx;
					}
				}
				.gallery-text{
					margin-left: 30rpx;
					display: inline-block;
					color: #333333;
					font-size: 30rpx;
					vertical-align: top;
					margin-top: 30rpx;
				}
				.gallery-att{
					display: inline-block;
					vertical-align: top;
					margin-top: 50rpx;
					float: right;
					margin-right: 30rpx;
					button{
						background-color: #B0E3FF;
						border: 1px solid #B0E3FF;
						color: #FFFFFF;
						font-size: 30rpx;
						line-height: 50rpx;
						border-radius: 20rpx;
						height: 50rpx;
					}
				}
			}
			.gallery-content{
				text{
					line-height: 80rpx;
					color: #333333;
				}
				.act{
					display:flex;
					width:100%;
					height: 320rpx;
					// flex-direction: row;
					// overflow-x: scroll;
					// overflow-y: hidden;
					.act-each{
						display: inline-block;
						width: 200rpx;	
						margin-right: 20rpx;
						margin-left: 10rpx;
						.act-img{
							width: 200rpx;
							height: 270rpx;
							image{
								width: 200rpx;
								height: 250rpx;
								border-radius: 30rpx;
							}
						}
						.act-name{
							text-align: center;
							line-height: 40rpx;
							color: #333333;
						}
					}
				}
			}
		}
	}
</style>
